package com.jack006.api.controller.admin;

import com.jack006.grace.result.GraceJSONResult;
import com.jack006.pojo.bo.AdminLoginBO;
import com.jack006.pojo.bo.NewAdminBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
 * @Classname AdminMngControllerApi
 * @Description 业务接口定义类
 * @Date 2021-06-10 08:15
 * @Created by jack
 */
@Api(value = "管理员 admin 维护",tags = "管理员 admin 维护的 controller")
@RequestMapping("/adminMng")
public interface AdminMngControllerApi {


    @ApiOperation(value = "管理员登录页面",notes = "管理员登录页面",httpMethod = "POST")
    @PostMapping("/adminLogin")
    GraceJSONResult adminLogin(@Valid @RequestBody AdminLoginBO adminLoginBO,
                               HttpServletRequest request,
                               HttpServletResponse response);


    @ApiOperation(value = "管理员用户名是否存在",notes = "管理员用户名是否存在",httpMethod = "POST")
    @PostMapping("/adminIsExist")
    GraceJSONResult adminIsExist(@RequestParam("userName") String userName);

    @ApiOperation(value = "创建 admin",notes = "创建 admin",httpMethod = "POST")
    @PostMapping("/addNewAdmin")
    GraceJSONResult addNewAdmin(@Valid @RequestBody NewAdminBO newAdminBO,
                                  HttpServletRequest request,
                                  HttpServletResponse response);


    @ApiOperation(value = "查询 admin 列表",notes = "查询 admin 列表",httpMethod = "POST")
    @PostMapping("/getAdminList")
    GraceJSONResult getAdminList(@ApiParam(name = "page",value = "查询下一页的第几页",required = false)
                                 @RequestParam Integer page,
                                 @ApiParam(name = "pageSize",value = "分页查询每一页显示的条数",required = false)
                                 @RequestParam Integer pageSize);

    @ApiOperation(value = "admin 退出登录",notes = "admin 退出登录",httpMethod = "POST")
    @PostMapping("/adminLogout")
    GraceJSONResult adminLogout(@RequestParam("adminId") String adminId,
                                HttpServletRequest request,
                                HttpServletResponse response);

    @ApiOperation(value = "admin 管理员的人脸登录",notes = "admin 管理员的人脸登录",httpMethod = "POST")
    @PostMapping("/adminFaceLogin")
    GraceJSONResult adminFaceLogin(@RequestBody AdminLoginBO adminLoginBO,
                                HttpServletRequest request,
                                HttpServletResponse response);



}
